cmake_minimum_required(VERSION 3.10)
project(OSGLearn)

# 设置策略以启用OpenSceneGraph_ROOT变量
cmake_policy(SET CMP0074 NEW)
set(OpenSceneGraph_ROOT "D:/soft/vcpkg/installed/x64-windows")

# 1. 查找 OSG 组件（按需添加），如果不指定，只会加载osg和osgdb
find_package(OpenSceneGraph REQUIRED
COMPONENTS osg osgDB osgGA osgViewer osgText osgUtil osgWidget)

# 2. 包含头文件目录
include_directories("C:/Program Files (x86)/OpenSceneGraph/include")

# 3. 添加可执行文件
add_executable(osgStart "osgStart.cpp" )

# 4. 链接库
target_link_libraries(osgStart ${OPENSCENEGRAPH_LIBRARIES})

# 3. 添加可执行文件
add_executable(osgStart2 "osgStart2.cpp" )

# 4. 链接库
target_link_libraries(osgStart2 ${OPENSCENEGRAPH_LIBRARIES})


# 3. 添加可执行文件
add_executable(cows "cows.cpp")

# 4. 链接库
target_link_libraries(cows ${OPENSCENEGRAPH_LIBRARIES})

# 3. 添加可执行文件
add_executable(shape "shape.cpp")
# 4. 链接库
target_link_libraries(shape ${OPENSCENEGRAPH_LIBRARIES})